#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int q,l,m;
ll b,x;
map<ll,bool> vis;
ll a[100005];
int main(void){
    scanf("%lld%d%d%d",&b,&q,&l,&m);
    for(int i=0;i<m;i++){
        scanf("%lld",&a[i]);
        vis[a[i]]=true;
    }
    if(abs(b)>l){
        printf("0\n");
    }else if(b==0){
        if(vis[0]){
            printf("0\n");
        }else{
            printf("inf\n");
        }
    }else if(q==0){
        if(!vis[0]){
            printf("inf\n");
        }else{
            if(!vis[b]){
                printf("1\n");
            }else{
                printf("0\n");
            }
        }
    }else if(q==1){
        if(vis[b]){
            printf("0\n");
        }else{
            printf("inf\n");
        }
    }else if(q==-1){
        if(vis[b] && vis[-b]){
            printf("0\n");
        }else{
            printf("inf\n");
        }
    }else{
        int cnt=0;
        sort(a,a+m);
        for(ll i=b;abs(i)<=l;i=i*q){
            if(!vis[i]){
                cnt++;
            }
        }
        printf("%d\n",cnt);
    }
    return 0;
}